define(['jquery','adminlte', 'bootstrap','bootstrap-table','Table'], function ($, undefined, undefined, undefined,Table) {
	var Controller = {
		index:function(){
			// 初始化表格参数配置
			Table.api.init({
                extend: {
                    index_url: 'page/index',
                    add_url: 'page/add',
                    edit_url: 'page/edit',
                    del_url: 'page/del',	//存在则出现删除按钮
                    multi_url: 'page/multi',
                    table: 'page',
                }
            });
			
			
			var table=$("#table");
			
			table.bootstrapTable({
				url: '../../assets/json/data2.json',
				columns: [
	                [
	                    {field: 'state', checkbox: true},
	                    {field: 'id', title: "ID"},
	                    {field: 'name', title: "名字"},
	                    {field: 'price', title: "余额",sortable:true},
	                    {field: 'operate', title: "操作",align:"center",events:Table.api.events.operate,formatter:Table.api.formatter.operate}
	                ]
	            ],
	            pagination:true,
	            toolbar:"#toolbar",
	            showRefresh:true,
	            search:true
	            
			})
			
			// 为表格绑定事件
            Table.api.bindevent(table);
		}
	}
	
	return Controller;
});
